Configuring ODBC Client Data Sources on Linux and UNIX

Information for UNIX users

For Linux and UNIX, an ODBC Administrator does not exist. This section describes how to configure the system information file and how to set some required environment variables to use the ODBC 32-bit Client and ODBC 64-bit Client on Linux and UNIX.

Configuring the System Information File

To configure an ODBC data source for Linux and UNIX, you must edit the odbc.ini file (32-bit Client) or odbc64.ini file (64-bit Client) using the attributes in Table 1-1 "ODBC Connection Attributes". In the following examples, notice that the description is the same for the 32-bit and 64-bit ODBC Client.

Example: odbc.ini for Solaris

The following code shows an example of an odbc.ini file for a 32-bit ODBC Client installed on a Solaris machine:

[ODBC Data Sources] 
SALESDB=DataDirect SequeLink 6.0 
[SALESDB] 
Driver=path_of_installdir/lib/ivslk22.so 
Description=DataDirect SequeLink 6.0 
Host= 
Port= 
UseLDAP=0 
DistinguishedName= 
Encrypted=0 
LoadBalancing=0 
AlternateServers= 
ConnectionRetryCount=0 
ConnectionRetryDelay=3 
[ODBC] 
Trace=0 
IANAAppCodePage=4 
TraceFile=odbctrace.out 
TraceDll=path_of_installdir/lib/odbctrac.so 
InstallDir=path_of_installdir 

where path_of_installdir is the path to the ODBC Client installation directory.

Example: odbc64.ini for Solaris

The following code shows an example of the odbc64.ini file for a 64-bit ODBC Client installed on a Solaris machine:

[ODBC Data Sources] 
SALESDB=DataDirect SequeLink 6.0 
[AccountingDB] 
Driver=path_of_installdir/lib64/ivslk22.so 
Description=DataDirect SequeLink 6.0 
Host= 
Port= 
UseLDAP=0 
DistinguishedName= 
Encrypted=0 
LoadBalancing=0 
AlternateServers= 
ConnectionRetryCount=0 
ConnectionRetryDelay=3 
[ODBC] 
Trace=0 
IANAAppCodePage=4 
TraceFile=odbctrace.out 
TraceDll=path_of_installdir/lib64/odbctrac.so 
InstallDir=path_of_installdir 

where path_of_installdir is the path to the ODBC Client installation directory.

Setting Environment Variables

You must set several environment variables for the ODBC Client on Linux and UNIX by executing a shell script located in the installation directory.

To execute the shell script:

Executing this shell script sets the following environment variables:

ODBCINI
Specifies where the centralized odbc.ini or odbc64.ini file is located.
SQLNK_ODBC_HOME
Specifies the full path of the directory containing the ODBC Client shared libraries.

Executing this shell script also sets the appropriate library search environment variable (LD_LIBRARY_PATH on Solaris and Linux, SHLIB_PATH on HP-UX, or LIBPATH on AIX).

Using a Centralized System Information File

Because Linux and UNIX are multi-user environments, you may want to use a single centralized odbc.ini file controlled by a system administrator. To do this, set the ODBCINI environment variable to point to the fully qualified pathname of the centralized file.

For example:

The odbc.ini file also require an [ODBC] section that includes the InstallDir keyword. The value of the InstallDir keyword must be the path to the directory that contains the /lib and /messages directories.

For example, if you choose the default installation directory for the 32-bit ODBC Client, the following line must be in the [ODBC] section of the odbc.ini file:

InstallDir=/usr/slodbc60